package org.example.controller;

import com.alibaba.nacos.client.logging.logback.LogbackNacosLogging;
import org.example.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

@RestController
@RequestMapping("/product")
public class ProductController {

    @GetMapping("/get_info")
    public String getInfo(Long id) throws InterruptedException {
        return "product ok! id=" + id;
    }

    @GetMapping("/{name}")
    public String getName(@PathVariable("name") String name) {
        return "product ok! name=" + name;
    }

    @PostMapping("/get_user")
    public String getUser(@RequestBody User user) {
        return "product ok! " + user.toString();
    }

    @GetMapping("/get_arr")
    public String getArr(@RequestParam("arr") String[] arr) {
        return "product ok!" + Arrays.toString(arr);
    }

    @PostMapping("/get_user_list")
    public User getUserList(@RequestBody User user) {
        return user;
    }

    @GetMapping("/get_data")
    public Object getData() {
        return 100L;
    }

}
